﻿using System;
using System.Diagnostics;

namespace Gildor.SimpleHostMonitor.Desktop.Entities
{
    /// <summary>
    /// Represents a single item of monitor log.
    /// </summary>
    [DebuggerDisplay ("Value = {Value}")]
    public class MonitorLogItem
    {
        //#region [For debugging use]
        //private static readonly Random _rand = new Random ();

        //public static MonitorLogItem Random
        //{
        //    get
        //    {
        //        return new MonitorLogItem (DateTime.Now, _rand.Next (1000));
        //    }
        //}
        //#endregion

        /// <summary>
        /// Gets or sets the time of the monitor operation.
        /// </summary>
        /// <value>The time of the monitor operation.</value>
        public DateTime Time { get; set; }

        /// <summary>
        /// Gets or sets the value.
        /// </summary>
        /// <value>The value.</value>
        public int Value { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this monitor operation is successful.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this monitor operation is successful; otherwise, <c>false</c>.
        /// </value>
        public bool IsSuccessful { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="MonitorLogItem"/> class.
        /// </summary>
        public MonitorLogItem ()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MonitorLogItem"/> class.
        /// </summary>
        /// <param name="time">The time.</param>
        /// <param name="value">The value.</param>
        /// <param name="isSuccessful">if set to <c>true</c> [is successful].</param>
        public MonitorLogItem (DateTime time, int value, bool isSuccessful)
        {
            Time = time;
            Value = value;
            IsSuccessful = isSuccessful;
        }
    }
}
